﻿using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Model;
using YouHP.Model.Group;
using YouHP.DALFactory;
using YouHP.Utility;

namespace YouHP.BLL
{
    public class TagBLL
    {
        #region Singleton
        static TagBLL _Instance;
        public static TagBLL Instance
        {
            get
            {
                if (_Instance == null)
                {
                    _Instance = new TagBLL();
                }
                return _Instance;
            }
        }
        #endregion


        public bool AddTag(TagInfo info)
        {

            return DataAccess.TagsDAL.AddTag(info);

        }

        public bool AddTagRelation(TagRelationInfo info)
        {
            return DataAccess.TagsDAL.AddTagRelation(info);
        }

        public bool DelTagRelation(int objTypeid, int objId,int tagId)
        {
            return DataAccess.TagsDAL.DelTagRelation(objTypeid,objId,tagId);
        }

        public List<TagInfo> GetHotTagList(int pageSize, int pageIndex, out int count)
        {
            return DataAccess.TagsDAL.GetHotTagList(pageSize, pageIndex, out count);
        }

        public List<TagInfo> GetTagListByObjId(int pageSize, int pageIndex, int objTypeId, int objId, out int count)
        {
            return DataAccess.TagsDAL.GetTagListByObjId(pageSize, pageIndex, objTypeId, objId, out count);
        }

        public TagInfo GetTagByName(string tag)
        {
            return DataAccess.TagsDAL.GetTagByName(tag);
        }

        public List<TopicInfo> GetTopicListByTag(int pagesize, int pageIndex, string tagName, out int count)
        {
            return DataAccess.TagsDAL.GetTopicListByTag(pagesize,pageIndex,tagName,out count);
        }

        public List<LogTopicInfo> GetLogTopicListByTag(int pagesize, int pageIndex, string tagName, out int count)
        {
            return DataAccess.TagsDAL.GetLogTopicListByTag(pagesize, pageIndex, tagName, out count);
        }


        public bool UpdateTagInfo(string TagName, int TagCntVal, int FCntVal, int LCntVal, int PCntVal, int VCntVal)
        {
            return DataAccess.TagsDAL.UpdateTagInfo(TagName,TagCntVal,FCntVal, LCntVal, PCntVal, VCntVal);
        }

        public bool CreateTopicTag(String[] tagStrArr, int objTypeId, int objId, int userId)
        {
            return DataAccess.TagsDAL.CreateTopicTag(tagStrArr,objTypeId, objId, userId);
        }

        public bool DelTopicTag(String[] tagStrArr, int objTypeId, int objId)
        {
            return DataAccess.TagsDAL.DelTopicTag(tagStrArr, objTypeId, objId);
        }


    
    }
}